'use strict'

var fs = require('fs');
var Promise = require('bluebird');

exports.readFileAsync = function(filePath, encoding){
	return new Promise(function(resolve, reject){
		fs.readFile(filePath, encoding, function(err, data){
			if (err) {
				reject(err);
			} else {
				resolve(data);
			}
		});
	});
};
exports.writeFileAsync = function(filePath, data){
	return new Promise(function(resolve, reject){
		fs.writeFile(filePath, data, function(err, data){
			if (err) {
				reject(err);
			} else {
				resolve();
			}
		});
	});
};